<?php
    define('ROOT_PATH', dirname(dirname(__FILE__)));
    define('VDS', DIRECTORY_SEPARATOR);
    $basedir = ltrim(dirname(dirname($_SERVER['SCRIPT_NAME'])));
    $basedir = ($basedir === VDS ? '' : $basedir);
    define('BASEDIR', $basedir);
    require ROOT_PATH . VDS . 'config.php';
    require ROOT_PATH . VDS . 'var.php';
    require ROOT_PATH . VDS . 'core/function.php';
    if ($_REQUEST['token'] != ENDE_KEY && DEV_MODE === 0 || $_REQUEST['token'] == '_sf20131111') {//如果token不正确或者是默认token，则不允许执行
        return;
    }
    if (empty($_REQUEST['code'])) {
        sfquit('not found code param');
    }
    $file = ROOT_DIR . '/asset/internal/report/' . $_REQUEST['code'] . '.log';
    if (is_file($file)) {
        sfquit('<pre>' . Core_IoUtils::instance()->readFile($file) . '</pre>');
    } else {
        sfquit('not found：' . $_REQUEST['code']);
    }